package com.fengniu.ejb.dao;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.fengniu.ejb.entity.TagLog;
import com.fengniu.ejb.entity.User;
import com.fengniu.ejb.entity.User2Category;
import com.fengniu.ejb.entity.User2Content;
import com.fengniu.ejb.entity.User2Site;
import com.fengniu.ejb.entity.User2User;

public interface IUserDao extends Serializable {
	// ---------Basic
	public User saveUser(User user);

	public void deleteUserBySysId(long sysId);

	public void deleteUserByUserId(String userId);

	public User findUserBySysId(long sysId);

	public User findUserByUserId(String userId);

	public User2Category findUser2CategoryBy(String userId, Integer[] relationIds, String categoryId);

	public User2Category findUser2CategoryBySysId(long user2CategorySysId);

	/**
	 * 
	 * @param userSysId
	 * @param relationType
	 * @param status
	 * @param categorySysId
	 * @param pgno
	 * @param pgsize
	 * @param orderBy
	 * @return
	 */
	public List<User2Category> getListUser2CategoryBy(long userSysId, Integer[] relationIds, long categorySysId,
			String[] statusIds, String[] userTypeIds, int pgno, int pgsize, String orderBy);

	public long getCountUser2CategoryBy(long userSysId, Integer[] relationIds, long categorySysId, String[] statusIds,
			String[] userTypeIds);

	public List<User2Category> getListUser2CategoryBy(String userId, Integer[] relationIds, String categoryId,
			String[] statusIds, String[] userTypeIds, int pgno, int pgsize, String orderBy);

	public long getCountUser2CategoryBy(String userId, Integer[] relationIds, String categoryId, String[] statusIds,
			String[] userTypeIds, int pgno, int pgsize, String orderBy);

	public List<User2Category> getListFriendUser2CategoryBy(long loginUserSysId, Integer[] relationIds,
			String[] statusIds, long categorySysId, int pgno, int pgsize, String orderBy);

	public long getCountFriendUser2CategoryBy(long loginUserSysId, Integer[] relationIds, String[] statusIds,
			long categorySysId);

	public void deleteUser2CategoryBySysId(long user2CategorySysId);

	public void deleteUser2SiteBySysId(long user2SiteSysId);

	public void deleteUser2ContentBySysId(long user2ContentSysId);

	public User2Category saveUser2Category(User2Category user2Category);

	// ---------------------User2Site---------
	public User2Site saveUser2Site(User2Site user2Site);

	/**
	 * get list of user 2 site
	 * 
	 * @param userSysId
	 * @param relationIds
	 * @param siteSysId
	 * @param statusIds
	 * @param siteTypeIds
	 * @param pgno
	 * @param pgsize
	 * @param orderBy
	 * @return
	 */
	public List<User2Site> getListUser2SiteBy(long userSysId, Integer[] relationIds, long siteSysId,
			Integer[] statusIds, Integer[] siteTypeIds, int pgno, int pgsize, String orderBy);

	/**
	 * get count of user 2 site
	 * 
	 * @param userSysId
	 * @param relationIds
	 * @param siteSysId
	 * @param statusIds
	 * @param siteTypeIds
	 * @return
	 */
	public long getCountUser2SiteBy(long userSysId, Integer[] relationIds, long siteSysId, Integer[] statusIds,
			Integer[] siteTypeIds);

	public List<User2Site> getListUser2SiteBy(String userId, Integer[] relationIds, String siteId,
			String[] siteTypeIds, String[] statusIds, int pgno, int pgsize, String orderBy);

	public long getCountUser2SiteBy(String userId, Integer[] relationIds, String siteId, String[] siteTypeIds,
			String[] statusIds);

	public List<User2Site> getListFriendUser2SiteBy(long userSysId, Integer[] relationIds, String[] statusIds,
			String siteTypeId, long siteSysId, int pgno, int pgsize, String orderBy);

	public long getCountFriendUser2SiteBy(long userSysId, Integer[] relationIds, String[] statusIds, String siteTypeId,
			long siteSysId);

	/**
	 * 
	 * @param userId
	 * @param id
	 * @param siteId
	 * @return
	 */
	public User2Site findUser2SiteBy(String userId, Integer relationId, String siteId);

	public User2Site findUser2SiteBy(long userSysId, Integer relationId, long siteSysId);

	/**
	 * 
	 * @param user2SiteSysId
	 * @return
	 */
	public User2Site findUser2SiteBy(long user2SiteSysId);

	public User2Content saveUser2Content(User2Content user2Content);

	public long getCountUser2ContentBy(long userSysId, Integer[] relationIds, long contentSysId, Integer[] statusIds,
			Integer[] contentTypeIds, String[] contentCategoryIds);

	/**
	 * get page of user 2 coupon
	 * 
	 * @param userSysId
	 * @param relationIds
	 * @param contentSysId
	 * @param statusIds
	 * @param contentTypeIds
	 * @param contentCategoryIds
	 * @param pgno
	 * @param pgsize
	 * @param orderBy
	 * @return
	 */
	public List<User2Content> getListUser2ContentBy(long userSysId, Integer[] relationIds, long contentSysId,
			Integer[] statusIds, Integer[] contentTypeIds, String[] contentCategoryIds, int pgno, int pgsize,
			String orderBy);

	/**
	 * get count of user2content
	 * 
	 * @param userId
	 * @param relationIds
	 * @param contentId
	 * @param statusIds
	 * @param contentTypeIds
	 * @param contentCategoryIds
	 * @return
	 */
	public long getCountUser2ContentBy(String userId, Integer[] relationIds, String contentId, Integer[] statusIds,
			Integer[] contentTypeIds, String[] contentCategoryIds);

	/**
	 * 
	 * @param userId
	 * @param relationIds
	 * @param contentId
	 * @param statusIds
	 * @param contentTypeIds
	 * @param pgno
	 * @param pgsize
	 * @param orderBy
	 * @return
	 */
	public List<User2Content> getListUser2ContentBy(String userId, Integer[] relationIds, String contentId,
			Integer[] statusIds, Integer[] contentTypeIds, String[] contentCategoryIds, int pgno, int pgsize,
			String orderBy);

	public long getCountFriendUsers2ContentBy(long loginUserSysId, Integer[] relationIds, long contentSysId,
			String[] statusIds, Integer relationId);

	public List<User2Content> getListFriendUsers2ContentBy(long loginUserSysId, Integer[] relationIds,
			long contentSysId, String[] statusIds, Integer relationId, int pgno, int pgsize, String orderBy);

	/**
	 * find User2Content by sysId
	 * 
	 * @param user2ContentSysId
	 * @return
	 */
	public User2Content findUser2ContentBy(long user2ContentSysId);

	public User2Content findUser2ContentBy(String userId, Integer relationId, String contentId);

	public User2Content findUser2ContentBy(long userSysId, Integer relationId, long contentSysId);

	public User2User findUser2UserBy(long user2UserSysId);

	public User2User findUser2UserBy(String userId, Integer relationId, Integer statusId, String userId2);

	public User2User findUser2UserBy(long userSysId, Integer relationId, Integer statusId, long userSysId2);

	/**
	 * 
	 * @param userSysId
	 * @param relationType
	 * @param status
	 * @param user2SysId
	 * @param pgno
	 * @param pgsize
	 * @param orderBy
	 */
	public List<User2User> getListUser2UserBy(long userSysId, Integer[] relationIds, Integer[] statusIds,
			long user2SysId, int pgno, int pgsize, String orderBy);

	public long getCountUser2UserBy(long userSysId, Integer[] relationIds, Integer[] statusIds, long user2SysId);

	public User2User saveUser2User(User2User user2User);

	/**
	 * delete user 2 coupon relations
	 * 
	 * @param userSysId
	 * @param id
	 * @param contentSysIds
	 */
	public void deleteUser2Contents(long userSysId, Integer relationId, long[] contentSysIds);

	/**
	 * get user count
	 * 
	 * @param afterLastUpdatedDate
	 * @return
	 */
	public long getCountUserBy(Date afterLastUpdatedDate);

	/**
	 * get list of user
	 * 
	 * @param afterLastUpdatedDate
	 * @param pgno
	 * @param pgsize
	 * @param orderBy
	 * @return
	 */
	public List<User> getListUserBy(Date afterLastUpdatedDate, int pgno, int pgsize, String orderBy);

	/**
	 * 
	 * @param user2ContentSysId
	 * @param relationId
	 * @param siteSysId
	 * @return
	 */
	// public Site2User_Content findUser2Content2Site(long user2ContentSysId,
	// Integer relationId, long siteSysId);
	/**
	 * 
	 * @param user2Content2Site
	 */
	// public void saveUser2Content2Site(Site2User_Content user2Content2Site);
	/**
	 * 
	 * @param user2Content2SiteSysId
	 * @param relationId
	 * @param siteSysIds
	 */
	public void deleteUser2Content2Sites(long user2Content2SiteSysId, Integer relationId, long[] siteSysIds);

	/**
	 * 
	 * @param user2ContentSysId
	 * @param relationIds
	 * @param siteSysId
	 * @param pgno
	 * @param pgsize
	 * @param orderBy
	 * @return
	 */
	// public List<Site2User_Content> getListUser2Content2SiteBy(long
	// user2ContentSysId, Integer[] relationIds,
	// long siteSysId, int pgno, int pgsize, String orderBy);
	/**
	 * 
	 * @param user2ContentSysId
	 * @param relationIds
	 * @param siteSysId
	 * @return
	 */
	public long getCountUser2Content2SiteBy(long user2ContentSysId, Integer[] relationIds, long siteSysId);

	/**
	 * find user by telphone,fax,email,userSysId,QQ,MSN number etc.
	 * 
	 * @param arbitraryUserId
	 * @return
	 */
	public User findUserByArbitraryId(String arbitraryUserId);
	
	public TagLog saveTagLog(TagLog tagLog);
	
}
